<template>
    <view class="header-container">
        <view class="back-container" v-show="showBack === 'true'" @click="goBack">
            <img src="@/static/img/common/back.png" />
        </view>
        <span>{{ title }}</span>
    </view>
</template>

<script setup>
import { onBeforeMount, onMounted, ref } from 'vue';
import { onReady } from '@dcloudio/uni-app';
const props = defineProps({
    title: String,
    showBack: {
        type: String,
        default: 'false'
    }
});
const emit = defineEmits(['onBackPress']);
function goBack() {
    uni.navigateBack();
}
</script>

<style lang="scss" scoped>
@import '/static/css/common.scss';
.header-container {
    @extend .row-layout;
    height: 44px;
    padding: 10px;
    background-color: white;
    position: relative;
    .back-container {
        @extend .row-layout;
        width: auto;
        padding: 15px;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        img {
            width: 7px;
            height: 14px;
        }
    }
    span {
        color: #333333;
        font-size: 18px;
    }
}
</style>
